// 字符串
/**
 * @param {string} version1
 * @param {string} version2
 * @return {number}
 */
 var compareVersion = function(version1, version2) {
    let v1=version1.split('.');
    let v2=version2.split('.');
    let n=Math.max(v1.length,v2.length);
    for(let i=0;i<n;i++){
    let c1=(v1[i]==undefined)?0:parseInt(v1[i]);
    let c2=(v2[i]==undefined)?0:parseInt(v2[i]);
    if(c1>c2)
    {
    return 1;}
    else if(c1<c2)
    {
    return -1;
    }
    }
    return 0;
    };